
# ========================================版本一===========================================
# 指定 CMake 的最低版本要求
# cmake_minimum_required(VERSION 3.1)

# 定义项目的名称和使用的编程语言
# project(TEMP CXX)
# set the project name and version
# project(TEMP VERSION 1.0.2)


# # 设置变量
# set(SRC_LIST main.cpp cat.cpp)


# # 指定要生成的可执行文件和其源文件
# add_executable(${PROJECT_NAME} ${SRC_LIST})

# ========================================版本2  多个文件夹===========================================
# # 指定 CMake 的最低版本要求
# cmake_minimum_required(VERSION 3.1)

# # 定义项目的名称和使用的编程语言
# # set the project name and version
# project(TEMP VERSION 1.0.2)


# # # 设置变量 target
# set(TARGET APP)
# # 添加文件
# aux_source_directory(./Src SRC_LIST)
# aux_source_directory(./Int INT_LIST)
# aux_source_directory(./Com COM_LIST)

# include_directories (./Int ./Com/include)

# # 指定要生成的可执行文件和其源文件
# add_executable(${TARGET} ${SRC_LIST} ${INT_LIST} ${COM_LIST})


# ========================================版本3  库===========================================
# # 指定 CMake 的最低版本要求
# cmake_minimum_required(VERSION 3.1)

# # 定义项目的名称和使用的编程语言
# # set the project name and version
# project(TEMP VERSION 1.0.2)


# # # 设置变量 target
# set(TARGET APP)
# # 添加文件
# aux_source_directory(./Src SRC_LIST)
# # aux_source_directory(./Int INT_LIST)
# # aux_source_directory(./Com COM_LIST)

# include_directories (./Int ./Com/include)


# #生成库 <name> [STATIC | SHARED | MODULE]
# # #生成静态库
# # add_library( static_int STATIC ${INT_LIST})
# # #生成动态库
# # add_library( shared_com SHARED ${COM_LIST})

# # 设置库文件生成路径
# set( LIBRARY_OUTPUT_PATH ../Library)
# # 设置生成可执行文件路径
# set(EXECUTABLE_OUTPUT_PATH ../)

# find_library(LIB_STATIC static_int ./Library)
# find_library(LIB_SHARED shared_com ./Library)




# # 指定要生成的可执行文件和其源文件
# # add_executable(${TARGET} ${SRC_LIST} ${INT_LIST} ${COM_LIST})
# add_executable(${TARGET} ${SRC_LIST})

# # 函数作用：把库lib_name链接到target可执行文件中
# target_link_libraries(${TARGET} ${LIB_STATIC} ${LIB_SHARED})


# ========================================版本4  文件操作===========================================
# 指定 CMake 的最低版本要求
cmake_minimum_required(VERSION 3.1)

# 定义项目的名称和使用的编程语言
# set the project name and version
project(EPOLL  VERSION 1.0.2 )


# 设置变量 target
set(TARGET App)


# 头文件 
include_directories (./Int ./Com ./Src)

# 查找文件
file(GLOB_RECURSE INT_LISTS ${PROJECT_SOURCE_DIR}/Int/*.*)
file(GLOB_RECURSE COM_LISTS ${PROJECT_SOURCE_DIR}/Com/*.*)
file(GLOB_RECURSE SRC_LISTS ${PROJECT_SOURCE_DIR}/Src/*.*)

# 拼接
set(SRCS ${INT_LISTS} ${COM_LISTS} ${SRC_LISTS})



# 设置库文件生成路径
set( LIBRARY_OUTPUT_PATH ../Lib)
# 设置生成可执行文件路径
set(EXECUTABLE_OUTPUT_PATH ../)

# find_library(LIB_STATIC static_int ./Library)
# find_library(LIB_SHARED shared_com ./Library)
find_library(LIB_STATIC pthread)


# 指定要生成的可执行文件和其源文件
add_executable(${TARGET} ${SRCS})

# 指定编译器参数
target_compile_options(${TARGET} PRIVATE -O2 -Wall -std=c++11)


# 函数作用：把库lib_name链接到target可执行文件中
# target_link_libraries(${TARGET} ${LIB_STATIC} ${LIB_SHARED})
target_link_libraries(${TARGET} ${LIB_STATIC})

